package com.asset.dispoal.file.feature;

import com.asset.dispoal.file.feature.api.FileFeatureTableService;
import com.asset.dispoal.file.feature.dto.FileFeatureTableCreateRequest;
import com.asset.dispoal.file.feature.dto.FileFeatureTableExpandCreateRequest;
import com.asset.dispoal.file.feature.dto.FileFeatureTableExpandPageRequest;
import com.asset.dispoal.file.feature.dto.FileFeatureTableExpandPageResponse;
import com.asset.dispoal.file.feature.dto.FileFeatureTableExpandUpdateRequest;
import com.asset.dispoal.file.feature.dto.FileFeatureTablePageRequest;
import com.asset.dispoal.file.feature.dto.FileFeatureTablePageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

@RestController
@Api(value = "要素表管理", tags = "要素表管理")
@RequestMapping("file/featureTable")
public class FileFeatureTableController {

    @Autowired
    FileFeatureTableService fileFeatureTableService;

    @ApiOperation(value = "要素表分页查询", notes = "要素表分页查询")
    @GetMapping("queryPage")
    public Result<PageVO<FileFeatureTablePageResponse>> queryPage(FileFeatureTablePageRequest request) {
        return fileFeatureTableService.queryPage(request);
    }

    @ApiOperation(value = "要素表创建", notes = "要素表创建")
    @PostMapping("create")
    public Result create(FileFeatureTableCreateRequest request) {
        return fileFeatureTableService.create(request);
    }

    @ApiOperation(value = "要素表删除", notes = "要素表删除")
    @DeleteMapping("delete")
    public Result delete(String id) {
        return fileFeatureTableService.delete(id);
    }

    @ApiOperation(value = "要素表扩展分页查询", notes = "要素表扩展分页查询")
    @GetMapping("queryExpandPage")
    public Result<PageVO<FileFeatureTableExpandPageResponse>> queryExpandPage(FileFeatureTableExpandPageRequest request) {
        return fileFeatureTableService.queryExpandPage(request);
    }

    @ApiOperation(value = "要素表扩展单个查询", notes = "要素表扩展单个查询")
    @GetMapping("getExpandById")
    public Result<FileFeatureTableExpandPageResponse> getExpandById(String id) {
        return fileFeatureTableService.getExpandById(id);
    }

    @ApiOperation(value = "要素表扩展创建", notes = "要素表扩展创建")
    @PostMapping("createExpand")
    public Result createExpand(@RequestBody FileFeatureTableExpandCreateRequest request) {
        return fileFeatureTableService.createExpand(request);
    }

    @ApiOperation(value = "要素表扩展创建", notes = "要素表扩展创建")
    @PostMapping("updateExpand")
    public Result updateExpand(@RequestBody FileFeatureTableExpandUpdateRequest request) {
        return fileFeatureTableService.updateExpand(request);
    }

    @ApiOperation(value = "要素表扩展删除", notes = "要素表扩展删除")
    @DeleteMapping("deleteExpand")
    public Result deleteExpand(String id) {
        return fileFeatureTableService.deleteExpand(id);
    }
}
